import pandas as pd


def trans(name):
    df = pd.read_excel(
        "storage/密堆积测试文件.xlsx",
        sheet_name="粒径分布"
    )
    lijing = df['粒径'].to_list()
    fenbu = df[name].to_list()
    res = []
    for i in range(len(lijing)):
        data = str(lijing[i]) + "\t" + str(fenbu[i]) + "\t" + "0"
        res.append(data)
    with open(f"storage/{name}.TXT", 'w', encoding="utf-8") as f:
        f.write("\n".join(res))
    # print(df)

if __name__ == "__main__":
    name = "BAK-5"
    trans(name)